package tests;

import common.WebAutoTest.TestUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
/**
 * @Author: wenjingyuan
 * @Date: 2023/09/18/10:44
 * @Description:
 */
public class MyBlogList extends TestUtils {
    @Test
    @BeforeAll
    static void init() {
        driver.get("http://121.40.90.244:8080/myblog_list.html");
    }
    /**
     * 未登陆状态：
     * 直接跳转登录页
     */
    @ParameterizedTest
    @ValueSource(strings = "http://120.27.224.221:8080/login.html")
    void blog_detail(String expected_url){
        //打开个人博客列表
        driver.get("http://121.40.90.244:8080/myblog_list.html");
        String cur_url = driver.getCurrentUrl();
        Assertions.assertEquals(cur_url,expected_url);

    }
    @Test
    @AfterAll
    static void exit() {
        driver.quit();
    }

}
